var mongoose = require('mongoose')
mongoose.connect('mongodb://test:123456@192.168.1.15/test')

var Schema = mongoose.Schema
var blogSchema = new Schema({
  title: String,
  author: String,
  body: String,
  comments: [{body: String, date: Date}],
  date: {type: Date, default: Date.now},
  hidden: Boolean,
  meta: {
    votes: Number,
    favs: Number
  }
})

var Blog = mongoose.model('Blog', blogSchema)
var blog = new Blog({title: 'blog1', author: 'yvan', body: 'blog1 body'})
blog.save(function(err, blog) {
  if (err) return console.error(err)
  console.log(blog)
})
